/*
package com.njbw.train.gateway.filter;

import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

@Slf4j
@Component
public class Test1Filter implements GlobalFilter, Ordered {

    // Mono 是事件编程/响应式编程的一个类
    @Override
    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
        log.info("Test1Filter");
        // 放行过滤器链
        return chain.filter(exchange);
        // 如果想让过滤器失败，直接结束请求调用
        // return exchange.getResponse().setComplete();
    }

    // order 数值越小越先执行，Filter 过滤器的顺序是按照 order 从小到大执行
    @Override
    public int getOrder() {
        return 0;
    }
}
*/
